package com.cloud.workTest;

import java.time.LocalDateTime;
import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.util.Date;

import static sun.security.krb5.Confounder.intValue;

public class DateTest {
    public static void main(String[] args) throws Exception{
        System.out.println(new SimpleDateFormat("yyyy-MM-dd hh:mm:ss").format(new Date()));
        System.out.println(LocalDate.now());
        System.out.println(LocalDate.now().minusMonths(13));

        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        SimpleDateFormat simpleDateFormat2 = new SimpleDateFormat("yyyy-MM-dd HH:mm");
        Date date = simpleDateFormat2.parse("2021-12-12 7:34");
        System.out.println(simpleDateFormat.format(date));
        System.out.println(simpleDateFormat.parse("2021-12-12 7:00:00"));

        String dateStr = "2021/09/23";
        String dateStr2 = dateStr.replaceAll("/","-");
        System.out.println(intValue());

    }
}
